package com.hnepri.fang.ftx.fetch.residentialDetail;

import com.hnepri.fang.ftx.fetch.HttpUtil;
import com.hnepri.fang.ftx.model.ResidentialDetail;

import java.io.IOException;

/**
 * 小区明细抓取
 * 一个类抓取一个页面
 */
public class ResidentialDetailPage {
    private String fid;//小区简介id
    private String url;

    public ResidentialDetailPage(String fid, String url) {
        this.fid = fid;
        this.url = url;
    }

    public String getPage() throws IOException {
        System.out.println("开始获取明细:" + url);
        String html = HttpUtil.getResidentialDetailPageHtml(url);
        ResidentialDetail detail = ResidentialDetailPageParser.parse(html);
        detail.setFid(fid);
        return detail.toString();
    }

    public static void main(String[] args) throws IOException {
        //ResidentialDetail residentialDetailFetch = new ResidentialDetail();
        //residentialDetailFetch.go();
        /*ResidentialDetail residentialDetail = new ResidentialDetail("http://tianhuiguangchangsl.fang.com/esf/");
        residentialDetail.go();*/
    }
}
